<!-- 原始数据 -->
<template>
  <div class="visits container-content">
    <div class="app-view-box">
      <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
        <el-tab-pane
          :label="item.label"
          :name="item.value"
          v-for="item in tabData"
          :key="item.value"
        >
          <!-- 结算方式 -->
          <template v-if="item.value === 'settlement'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('settlement')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting('settlement')"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="settleTable"
              :data="tableSettleData"
              stripe
              border
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <el-table-column prop="bizCode" label="编码">
                <template slot-scope="scope">
                  {{ scope.row.bizCode || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="title" label="名称">
                <template slot-scope="scope">
                  {{ scope.row.title || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="isDefault" label="是否为默认结算方式">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.isDefault === 1" type="success"
                    >是</el-tag
                  >
                  <el-tag v-else-if="scope.row.isDefault === 2" type="danger"
                    >否</el-tag
                  >
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="isDisabled" label="是否禁用">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.isDisabled === 1" type="danger"
                    >是</el-tag
                  >
                  <el-tag v-else-if="scope.row.isDisabled === 2" type="success"
                    >否</el-tag
                  >
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="isSupportLinePay" label="是否支持网银付款">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.isSupportLinePay === 1" type="success"
                    >是</el-tag
                  >
                  <el-tag
                    v-else-if="scope.row.isSupportLinePay === 2"
                    type="danger"
                    >否</el-tag
                  >
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="isPayFee" label="是否支付手续费">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.isPayFee === 1" type="success"
                    >是</el-tag
                  >
                  <el-tag v-else-if="scope.row.isPayFee === 2" type="danger"
                    >否</el-tag
                  >
                  <span v-else>--</span>
                </template>
              </el-table-column>

              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      @click="handleDetail(scope.$index, scope.row)"
                      size="mini"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 收付款用途 -->
          <template v-if="item.value === 'payment'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('payment')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting('payment')"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="paymentTable"
              :data="tablePaymentData"
              stripe
              border
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <el-table-column prop="bizCode" label="编码">
                <template slot-scope="scope">
                  <span v-if="scope.row.bizCode">{{ scope.row.bizCode }}</span>
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="title" label="名称">
                <template slot-scope="scope">
                  <span v-if="scope.row.title">{{ scope.row.title }}</span>
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="receiptPayType" label="收付款类型">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.receiptPayType === 1" type="success"
                    >收款</el-tag
                  >
                  <el-tag
                    v-else-if="scope.row.receiptPayType === 2"
                    type="danger"
                    >付款</el-tag
                  >
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="purposeDesc" label="描述">
                <template slot-scope="scope">
                  <span v-if="scope.row.purposeDesc">{{
                    scope.row.purposeDesc
                  }}</span>
                  <span v-else>--</span>
                </template>
              </el-table-column>

              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      @click="handleDetail(scope.$index, scope.row)"
                      size="mini"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 币别 -->
          <template v-if="item.value === 'currency'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('currency')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting('currency')"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="paymentTable"
              :data="tableCurrencyData"
              stripe
              border
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <el-table-column prop="currencyName" label="币别名称">
                <template slot-scope="scope">{{
                  scope.row.currencyName || "--"
                }}</template>
              </el-table-column>
              <el-table-column prop="currencySymbol" label="货币代码"
                ><template slot-scope="scope">{{
                  scope.row.currencySymbol || "--"
                }}</template></el-table-column
              >
              <el-table-column prop="code" label="币别编码"
                ><template slot-scope="scope">{{
                  scope.row.code || "--"
                }}</template></el-table-column
              >
              <el-table-column prop="amountAccuracy" label="金额精度"
                ><template slot-scope="scope">{{
                  scope.row.amountAccuracy || "--"
                }}</template></el-table-column
              >
              <el-table-column prop="dataStatus" label="数据状态">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.dataStatus === 1">创建</el-tag>
                  <el-tag v-else-if="scope.row.dataStatus === 2">审核中</el-tag>
                  <el-tag v-else-if="scope.row.dataStatus === 3">已审核</el-tag>
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="isDisabled" label="是否禁用">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.isDisabled === 1" type="danger"
                    >是</el-tag
                  >
                  <el-tag v-else-if="scope.row.isDisabled === 2" type="success"
                    >否</el-tag
                  >
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="priceAccuracy" label="单价精度"
                ><template slot-scope="scope">{{
                  scope.row.priceAccuracy || "--"
                }}</template></el-table-column
              >
              <el-table-column prop="showFlag" label="单据显示货币符号">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.showFlag === 1" type="success"
                    >是</el-tag
                  >
                  <el-tag v-else-if="scope.row.showFlag === 2" type="danger"
                    >否</el-tag
                  >
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      @click="handleDetail(scope.$index, scope.row)"
                      size="mini"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>

                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 汇率体系 -->
          <template v-if="item.value === 'exchange'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('exchange')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting('exchange')"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="paymentTable"
              :data="tableExchangeData"
              stripe
              border
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <el-table-column prop="indirectRate" label="间接汇率">
                <template slot-scope="scope">
                  {{ scope.row.indirectRate || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="directRate" label="直接汇率">
                <template slot-scope="scope">
                  {{ scope.row.directRate || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="deptId" label="所属公司">
                <template slot-scope="scope">
                  {{ scope.row.deptId || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="effectiveTime" label="生效日期">
                <template slot-scope="scope">
                  {{ scope.row.effectiveTime || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="invalidTime" label="失效日期">
                <template slot-scope="scope">
                  {{ scope.row.invalidTime || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="remark" label="备注">
                <template slot-scope="scope">
                  {{ scope.row.remark || "--" }}
                </template>
              </el-table-column>

              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      @click="handleDetail(scope.$index, scope.row)"
                      size="mini"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 费用项目 -->
          <template v-if="item.value === 'expense'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('expense')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting('expense')"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="paymentTable"
              :data="tableExpenseData"
              stripe
              border
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <el-table-column prop="feeCode" label="编码">
                <template slot-scope="scope">
                  {{ scope.row.feeCode || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="title" label="名称">
                <template slot-scope="scope">
                  {{ scope.row.title || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="taxRate" label="税率">
                <template slot-scope="scope">
                  {{ scope.row.taxRate || "--" }}
                </template>
              </el-table-column>

              <el-table-column prop="deptId" label="所属公司">
                <template slot-scope="scope">
                  {{ scope.row.deptId || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="costCategory" label="存货成本类别">
                <template slot-scope="scope">
                  {{ scope.row.costCategory || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="costDesc" label="描述">
                <template slot-scope="scope">
                  {{ scope.row.costDesc || "--" }}
                </template>
              </el-table-column>
              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      @click="handleDetail(scope.$index, scope.row)"
                      size="mini"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 单据类型 -->
          <template v-if="item.value === 'document'">
            <el-row :gutter="20" class="mt20">
              <el-col :span="6">
                <el-card>
                  <el-tree
                    :data="treeDataDoc"
                    :props="defaultPropsDoc"
                    @node-click="handleNodeClick"
                  >
                  </el-tree>
                </el-card>
              </el-col>
              <el-col :span="18">
                <el-row class="export-container">
                  <el-button type="primary" @click="addNewData('document')"
                    >新增</el-button
                  >
                  <el-button
                    type="primary"
                    icon="el-icon-upload2"
                    size="mini"
                    @click="exporting('document')"
                    >导出</el-button
                  >
                  <el-button type="primary" icon="el-icon-bottom" size="mini"
                    >拉取</el-button
                  >
                  <el-button type="primary" icon="el-icon-download" size="mini"
                    >导入</el-button
                  >
                </el-row>
                <el-table
                  ref="documentTable"
                  :data="tableDocumentData"
                  stripe
                  border
                  style="width: 100%"
                  @selection-change="handleSelectionChange"
                >
                  <el-table-column
                    type="selection"
                    width="55"
                    align="center"
                  ></el-table-column>
                  <el-table-column
                    prop="keyCode"
                    label="keyCode"
                  ></el-table-column>
                  <el-table-column prop="docCode" label="单据编码">
                    <template slot-scope="scope">
                      {{ scope.row.docCode || "--" }}
                    </template>
                  </el-table-column>
                  <el-table-column prop="title" label="单据名称">
                    <template slot-scope="scope">
                      {{ scope.row.title || "--" }}
                    </template>
                  </el-table-column>
                  <el-table-column prop="deptId" label="所属公司">
                    <template slot-scope="scope">
                      {{ scope.row.deptId || "--" }}
                    </template>
                  </el-table-column>
                  <el-table-column prop="parentId" label="所属父单据">
                    <template slot-scope="scope">
                      {{ scope.row.parentId || "--" }}
                    </template>
                  </el-table-column>
                  <el-table-column prop="level" label="单据级别">
                    <template slot-scope="scope">
                      {{ scope.row.level || "--" }}
                    </template>
                  </el-table-column>

                  <el-table-column label="操作" width="240">
                    <template slot-scope="scope">
                      <el-tooltip
                        class="item"
                        effect="dark"
                        content="详情"
                        placement="bottom"
                      >
                        <el-button
                          plain
                          icon="el-icon-more"
                          @click="handleDetail(scope.$index, scope.row)"
                          size="mini"
                        ></el-button>
                      </el-tooltip>
                      <el-tooltip
                        class="item"
                        effect="dark"
                        content="编辑"
                        placement="bottom"
                      >
                        <el-button
                          type="primary"
                          plain
                          icon="el-icon-edit"
                          size="mini"
                          @click="handleEdit(scope.$index, scope.row)"
                        ></el-button>
                      </el-tooltip>
                      <el-tooltip
                        class="item"
                        effect="dark"
                        content="删除"
                        placement="bottom"
                      >
                        <el-button
                          type="danger"
                          plain
                          icon="el-icon-delete"
                          size="mini"
                          @click="handleDelete(scope.$index, scope.row)"
                        ></el-button>
                      </el-tooltip>
                      <el-tooltip
                        class="item"
                        effect="dark"
                        content="禁用"
                        placement="bottom"
                        v-if="scope.row.isDisabled == 2"
                      >
                        <el-button
                          type="danger"
                          plain
                          icon="el-icon-error"
                          size="mini"
                          @click="Banned(scope.$index, scope.row)"
                        ></el-button>
                      </el-tooltip>
                      <el-tooltip
                        class="item"
                        effect="dark"
                        content="解禁"
                        placement="bottom"
                        v-if="scope.row.isDisabled == 1"
                      >
                        <el-button
                          type="primary"
                          plain
                          icon="el-icon-success"
                          size="mini"
                          @click="Banned(scope.$index, scope.row)"
                        ></el-button>
                      </el-tooltip>
                    </template>
                  </el-table-column>
                </el-table>
              </el-col>
            </el-row>
          </template>
          <!-- 银行账户 -->
          <template v-if="item.value === 'bankAccount'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('bankAccount')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting('bankAccount')"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="bankTable"
              :data="tableBankAccountData"
              stripe
              border
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <el-table-column prop="bankCode" label="编码">
                <template slot-scope="scope">
                  {{ scope.row.bankCode || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="account" label="账号">
                <template slot-scope="scope">
                  {{ scope.row.account || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="deptId" label="所属公司">
                <template slot-scope="scope">
                  {{ scope.row.deptId || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="title" label="银行名称">
                <template slot-scope="scope">
                  {{ scope.row.title || "--" }}
                </template>
              </el-table-column>

              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      @click="handleDetail(scope.$index, scope.row)"
                      size="mini"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 往来单位 -->
          <template v-if="item.value === 'contact'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('contact')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting('contact')"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="paymentTable"
              :data="tableContactData"
              stripe
              border
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <el-table-column prop="companyCode" label="编码">
                <template slot-scope="scope">
                  {{ scope.row.companyCode || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="deptId" label="所属公司">
                <template slot-scope="scope">
                  {{ scope.row.deptId || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="dataStatus" label="数据状态">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.dataStatus === 1">创建</el-tag>
                  <el-tag v-else-if="scope.row.dataStatus === 2">审核中</el-tag>
                  <el-tag v-else-if="scope.row.dataStatus === 3">已审核</el-tag>
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="isDisabled" label="是否禁用">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.isDisabled === 1" type="danger"
                    >是</el-tag
                  >
                  <el-tag v-else-if="scope.row.isDisabled === 2" type="success"
                    >否</el-tag
                  >
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="companyDesc" label="描述">
                <template slot-scope="scope">
                  {{ scope.row.companyDesc || "--" }}
                </template>
              </el-table-column>
              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      @click="handleDetail(scope.$index, scope.row)"
                      size="mini"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 税率 -->
          <template v-if="item.value === 'tax'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('tax')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting('tax')"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="paymentTable"
              :data="tableTaxData"
              stripe
              border
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>

              <el-table-column prop="rateCode" label="编码">
                <template slot-scope="scope">
                  {{ scope.row.rateCode || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="title" label="名称">
                <template slot-scope="scope">
                  {{ scope.row.title || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="deptId" label="所属公司">
                <template slot-scope="scope">
                  {{ scope.row.deptId || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="rate" label="税率">
                <template slot-scope="scope">
                  {{ scope.row.rate || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="dataStatus" label="数据状态">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.dataStatus === 1">创建</el-tag>
                  <el-tag v-else-if="scope.row.dataStatus === 2">审核中</el-tag>
                  <el-tag v-else-if="scope.row.dataStatus === 3">已审核</el-tag>
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="isAddTax" label="是否增值税">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.isAddTax === 1" type="success"
                    >是</el-tag
                  >
                  <el-tag v-else-if="scope.row.isAddTax === 2" type="danger"
                    >否</el-tag
                  >
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="isBuyReplace" label="买方代扣代缴">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.isBuyReplace === 1" type="success"
                    >是</el-tag
                  >
                  <el-tag v-else-if="scope.row.isBuyReplace === 2" type="danger"
                    >否</el-tag
                  >
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="isSellReplace" label="卖方代扣代缴">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.isSellReplace === 1" type="success"
                    >是</el-tag
                  >
                  <el-tag
                    v-else-if="scope.row.isSellReplace === 2"
                    type="danger"
                    >否</el-tag
                  >
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="isTaxInvoice" label="是否开增值税发票">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.isTaxInvoice === 1" type="success"
                    >是</el-tag
                  >
                  <el-tag v-else-if="scope.row.isTaxInvoice === 2" type="danger"
                    >否</el-tag
                  >
                  <span v-else>--</span>
                </template>
              </el-table-column>
              <el-table-column prop="effectiveTime" label="生效日期">
                <template slot-scope="scope">
                  {{ scope.row.effectiveTime || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="invalidTime" label="失效日期">
                <template slot-scope="scope">
                  {{ scope.row.invalidTime || "--" }}
                </template>
              </el-table-column>
              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      @click="handleDetail(scope.$index, scope.row)"
                      size="mini"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 安全库存设置 -->
          <template v-if="item.value === 'stock'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('stock')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting('stock')"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="paymentTable"
              :data="tableStockData"
              stripe
              border
              style="width: 100%"
               @row-dblclick="getRow"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <el-table-column prop="deptId" label="所属公司">
                <template slot-scope="scope">
                  {{ scope.row.deptId || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="unit" label="计量单位">
                <template slot-scope="scope">
                  {{ scope.row.unit || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="safetyStockNum" label="安全库存量">
                <template slot-scope="scope">
                  {{ scope.row.safetyStockNum || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="maxStockNum" label="最大库存数量">
                <template slot-scope="scope">
                  {{ scope.row.maxStockNum || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="minBuyNum" label="最小订购量">
                <template slot-scope="scope">
                  {{ scope.row.minBuyNum || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="minPackNum" label="最小包装量">
                <template slot-scope="scope">
                  {{ scope.row.minPackNum || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="economyNum" label="经济订货点">
                <template slot-scope="scope">
                  {{ scope.row.economyNum || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="againBuyNum" label="再订货点">
                <template slot-scope="scope">
                  {{ scope.row.againBuyNum || "--" }}
                </template>
              </el-table-column>
              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      @click="handleDetail(scope.$index, scope.row)"
                      size="mini"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 成本中心 -->
          <template v-if="item.value === 'cost'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('cost')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting('cost')"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="paymentTable"
              :data="tableCostData"
              stripe
              border
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <el-table-column prop="costCode" label="编码">
                <template slot-scope="scope">
                  {{ scope.row.costCode || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="deptId" label="所属公司">
                <template slot-scope="scope">
                  {{ scope.row.deptId || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="relation" label="关联部门">
                <template slot-scope="scope">
                  {{ scope.row.relation || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="title" label="名称">
                <template slot-scope="scope">
                  {{ scope.row.title || "--" }}
                </template>
              </el-table-column>

              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      @click="handleDetail(scope.$index, scope.row)"
                      size="mini"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 银行 -->
          <template v-if="item.value === 'bank'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('bank')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="paymentTable"
              :data="tableBankData"
              stripe
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <el-table-column prop="code" label="编码"></el-table-column>

              <el-table-column prop="title" label="银行名称"></el-table-column>
              <el-table-column
                prop="bankAddress"
                label="银行地址"
              ></el-table-column>
              <el-table-column prop="bankDesc" label="描述"></el-table-column>
              <el-table-column
                prop="createTime"
                label="创建时间"
              ></el-table-column>
              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      @click="handleDetail(scope.$index, scope.row)"
                      size="mini"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 仓库及仓位 -->
          <template v-if="item.value === 'warehouse'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('warehouse')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="wareTable"
              :data="tableWareData"
              stripe
              style="width: 100%"
            >
              <!-- @selection-change="handleSelectionChange" -->
              <el-table-column type="selection" width="55" align="center">
              </el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              >
              </el-table-column>
              <el-table-column
                prop="wareName"
                label="仓库名称"
              ></el-table-column>
              <el-table-column
                prop="wareCode"
                label="仓库编码"
              ></el-table-column>
              <el-table-column prop="telPhone" label="联系电话">
              </el-table-column>
              <el-table-column prop="address" label="地址"> </el-table-column>
              <el-table-column
                prop="changeTime"
                label="更新时间"
              ></el-table-column>
              <el-table-column
                prop="createTime"
                label="创建时间"
              ></el-table-column>

              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      size="small"
                      @click="handleDetail(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      size="small"
                      icon="el-icon-edit"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      size="small"
                      icon="el-icon-delete"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>

          <!-- 客户 -->
          <template v-if="item.value === 'customer'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('customer')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="customerTable"
              :data="tableCustomerData"
              stripe
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column type="selection" width="55" align="center">
              </el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              >
              </el-table-column>
              <el-table-column prop="customerName" label="客户名称" fixed>
                <!-- <template slot-scope="scope">
                      <router-link
                        :to="{
                          path: '/CustomerManager/CustomerDetail',
                          query: { id: scope.row.id },
                        }"
                      >
                        <el-link type="primary" href="">{{
                          scope.row.customerName
                        }}</el-link>
                      </router-link>
                    </template> -->
              </el-table-column>
              <el-table-column
                prop="customerAttributeId"
                label="客户属性"
              ></el-table-column>
              <el-table-column prop="telPhone" label="电话"></el-table-column>
              <el-table-column
                prop="companyId"
                label="上级公司"
              ></el-table-column>
              <el-table-column prop="provincesId" label="省"></el-table-column>
              <el-table-column
                prop="address"
                label="详细地址"
              ></el-table-column>
              <el-table-column prop="remarks" label="备注"></el-table-column>
              <el-table-column
                prop="createTime"
                label="创建日期"
              ></el-table-column>
              <el-table-column label="操作" fixed="right" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      size="mini"
                      @click="handleDetail(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 部门 -->
          <template v-if="item.value === 'department'">
            <el-row class="export-container">
              <el-button
                type="primary"
                icon="el-icon-plus"
                @click="addNewData('department')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              v-loading="loading"
              :data="deptList"
              row-key="deptId"
              default-expand-all
              :tree-props="{
                children: 'children',
                hasChildren: 'hasChildren',
              }"
            >
              <el-table-column
                prop="deptName"
                label="部门名称"
                width="260"
              ></el-table-column>
              <el-table-column
                prop="deptCode"
                label="编码"
                width="200"
              ></el-table-column>
              <el-table-column
                prop="orderNum"
                label="排序"
                width="200"
              ></el-table-column>
              <el-table-column
                prop="status"
                label="状态"
                :formatter="statusFormat"
                width="100"
              ></el-table-column>
              <el-table-column
                label="创建时间"
                align="center"
                prop="createTime"
                width="200"
              >
                <template slot-scope="scope">
                  <span>{{ parseTime(scope.row.createTime) }}</span>
                </template>
              </el-table-column>
            <el-table-column label="操作" fixed="right" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      size="mini"
                      @click="handleDetail(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>

          <!-- 供应商 -->
          <template v-if="item.value === 'supplier'">
            <el-row class="export-container">
              <el-button type="primary" @click="addNewData('supplier')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="paymentTable"
              :data="tableSupplierData"
              stripe
              style="width: 100%"
              @selection-change="handleSelectionChange"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              ></el-table-column>
              <el-table-column prop="supplierCode" label="编码">
                <template slot-scope="scope">
                  {{ scope.row.supplierCode || "--" }}
                </template>
              </el-table-column>
              <el-table-column prop="supplierName" label="名称"
                ><template slot-scope="scope">
                  {{ scope.row.supplierName || "--" }}
                </template></el-table-column
              >
              <el-table-column prop="supplierGroup" label="供应商分组"
                ><template slot-scope="scope">
                  {{ scope.row.supplierGroup || "--" }}
                </template></el-table-column
              >
              <el-table-column prop="createTime" label="创建时间"
                ><template slot-scope="scope">
                  {{ scope.row.createTime || "--" }}
                </template></el-table-column
              >

              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      @click="handleDetail(scope.$index, scope.row)"
                      size="mini"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-edit"
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-delete"
                      size="mini"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 物料 -->
          <template v-if="item.value === 'material'">
            <el-row :gutter="20" class="mt20">
              <el-col :span="6">
                <el-card>
                  <el-tree
                    :data="treeDataMaterial"
                    :props="defaultProps"
                    node-key="id"
                    :default-expanded-keys="treeData"
                    @node-click="handleNodeClickMaterial"
                  >
                  </el-tree>
                </el-card>
              </el-col>
              <el-col :span="18">
                <el-row class="export-container">
                  <el-button
                    type="primary"
                    icon="el-icon-plus"
                    size="mini"
                    @click="addNewData('material')"
                    >新增</el-button
                  >
                  <el-button
                    type="primary"
                    icon="el-icon-upload2"
                    size="mini"
                    @click="exporting"
                    >导出</el-button
                  >
                  <el-button type="primary" icon="el-icon-bottom" size="mini"
                    >拉取</el-button
                  >
                  <el-button type="primary" icon="el-icon-download" size="mini"
                    >导入</el-button
                  >
                </el-row>
                <el-table
                  v-loading="materialLoading"
                  ref="materialTable"
                  :data="tableDataMaterial"
                  stripe
                  style="width: 100%"
                >
                  <!-- @selection-change="handleSelectionChange" -->
                  <el-table-column type="selection" width="55" align="center">
                  </el-table-column>
                  <el-table-column
                    type="index"
                    width="55"
                    align="center"
                    label="序号"
                  >
                  </el-table-column>
                  <el-table-column
                    prop="materialName"
                    label="物料名称"
                  ></el-table-column>
                  <el-table-column
                    prop="materialCode"
                    label="物料编码"
                  ></el-table-column>
                  <el-table-column
                    prop="typeName"
                    label="分类名称"
                  ></el-table-column>
                  <el-table-column prop="unit" label="单位"></el-table-column>
                  <el-table-column prop="model" label="规格型号">
                  </el-table-column>
                  <el-table-column prop="paramDesc" label="参数说明">
                  </el-table-column>
                  <el-table-column prop="brand" label="品牌"></el-table-column>
                  <el-table-column prop="type" label="物料类型">
                    <template slot-scope="scope">
                      <el-tag v-if="scope.row.type == '1'">自购物料</el-tag>
                      <el-tag v-if="scope.row.type == '2'">甲购物料</el-tag>
                    </template>
                  </el-table-column>

                  <el-table-column label="操作" width="240">
                    <template slot-scope="scope">
                      <el-tooltip
                        class="item"
                        effect="dark"
                        content="详情"
                        placement="bottom"
                      >
                        <el-button
                          plain
                          icon="el-icon-more"
                          size="small"
                          @click="handleDetail(scope.$index, scope.row)"
                        ></el-button>
                      </el-tooltip>
                      <el-tooltip
                        class="item"
                        effect="dark"
                        content="编辑"
                        placement="bottom"
                      >
                        <el-button
                          type="primary"
                          plain
                          size="small"
                          icon="el-icon-edit"
                          @click="handleEdit(scope.$index, scope.row)"
                        ></el-button>
                      </el-tooltip>
                      <el-tooltip
                        class="item"
                        effect="dark"
                        content="删除"
                        placement="bottom"
                      >
                        <el-button
                          type="danger"
                          plain
                          size="small"
                          icon="el-icon-delete"
                          @click="handleDelete(scope.$index, scope.row)"
                        ></el-button>
                      </el-tooltip>
                      <el-tooltip
                        class="item"
                        effect="dark"
                        content="禁用"
                        placement="bottom"
                        v-if="scope.row.isDisabled == 2"
                      >
                        <el-button
                          type="danger"
                          plain
                          icon="el-icon-error"
                          size="mini"
                          @click="Banned(scope.$index, scope.row)"
                        ></el-button>
                      </el-tooltip>
                      <el-tooltip
                        class="item"
                        effect="dark"
                        content="解禁"
                        placement="bottom"
                        v-if="scope.row.isDisabled == 1"
                      >
                        <el-button
                          type="primary"
                          plain
                          icon="el-icon-success"
                          size="mini"
                          @click="Banned(scope.$index, scope.row)"
                        ></el-button>
                      </el-tooltip>
                    </template>
                  </el-table-column>
                </el-table>
              </el-col>
            </el-row>
          </template>
          <!-- 供应商分组 -->
          <template v-if="item.value === 'group'">
            <el-row class="export-container">
              <el-button type="primary" @click="addNewData('group')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="groupTable"
              :data="tableGroupData"
              stripe
              style="width: 100%"
            >
              <!-- @selection-change="handleSelectionChange" -->
              <el-table-column type="selection" width="55" align="center">
              </el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              >
              </el-table-column>
              <el-table-column prop="code" label="编码"></el-table-column>
              <el-table-column prop="name" label="名称"></el-table-column>
              <el-table-column prop="userId" label="创建人"></el-table-column>
              <el-table-column prop="describe" label="描述"></el-table-column>
              <el-table-column
                prop="createTime"
                label="创建时间"
              ></el-table-column>
              <el-table-column
                prop="changeTime"
                label="更新时间"
              ></el-table-column>

              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      size="small"
                      @click="handleDetail(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      size="small"
                      icon="el-icon-edit"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      size="small"
                      icon="el-icon-delete"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 采购组 -->
          <template v-if="item.value === 'purchase'">
            <el-row class="export-container">
              <el-button type="primary" @click="addNewData('purchase')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="groupTable"
              :data="tablePurchaseData"
              stripe
              style="width: 100%"
            >
              <!-- @selection-change="handleSelectionChange" -->
              <el-table-column type="selection" width="55" align="center">
              </el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              >
              </el-table-column>
              <el-table-column
                prop="businessGroupType"
                label="业务组"
              ></el-table-column>
              <el-table-column prop="userId" label="创建人"></el-table-column>
              <el-table-column
                prop="describeInfo"
                label="描述"
              ></el-table-column>
              <el-table-column
                prop="createTime"
                label="创建时间"
              ></el-table-column>
              <el-table-column
                prop="changeTime"
                label="更新时间"
              ></el-table-column>

              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      size="small"
                      @click="handleDetail(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      size="small"
                      icon="el-icon-edit"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      size="small"
                      icon="el-icon-delete"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 默认价目表 -->
          <template v-if="item.value === 'price'">
            <el-row class="export-container">
              <el-button type="primary" @click="addNewData('price')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="groupTable"
              :data="tablePriceData"
              stripe
              style="width: 100%"
            >
              <!-- @selection-change="handleSelectionChange" -->
              <el-table-column type="selection" width="55" align="center">
              </el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              >
              </el-table-column>
              <el-table-column prop="code" label="编码"></el-table-column>
              <el-table-column prop="name" label="名称"></el-table-column>
              <el-table-column prop="extraTax" label="价外税"></el-table-column>
              <el-table-column
                prop="priceType"
                label="价格类型"
              ></el-table-column>
              <el-table-column prop="type" label="类型">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.type === 0">价目表</el-tag>
                  <el-tag v-if="scope.row.type === 1">折扣表</el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="includingTax" label="是否含税">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.includingTax" type="success"
                    >是</el-tag
                  >
                  <el-tag v-if="!scope.row.includingTax" type="danger"
                    >否</el-tag
                  >
                </template>
              </el-table-column>
              <el-table-column prop="isDefault" label="是否默认">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.isDefault" type="success">是</el-tag>
                  <el-tag v-if="!scope.row.isDefault" type="danger">否</el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="isTemp" label="是否暂存">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.isTemp" type="success">是</el-tag>
                  <el-tag v-if="!scope.row.isTemp" type="danger">否</el-tag>
                </template>
              </el-table-column>

              <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      size="small"
                      @click="handleDetail(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      size="small"
                      icon="el-icon-edit"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      size="small"
                      icon="el-icon-delete"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 付款条件 -->
          <template v-if="item.value === 'pay'">
            <el-row class="export-container">
              <el-button type="primary" @click="addNewData('pay')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="payTable"
              :data="tablePayData"
              stripe
              style="width: 100%"
            >
              <el-table-column type="selection" width="55" align="center">
              </el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              >
              </el-table-column>
              <el-table-column
                prop="conditionCode"
                label="编码"
              ></el-table-column>
              <el-table-column prop="title" label="名称"></el-table-column>
              <el-table-column prop="deptId" label="所属公司"></el-table-column>

              <el-table-column prop="type" label="类型">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.type === 1">收款条件</el-tag>
                  <el-tag v-if="scope.row.type === 2">付款条件</el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="dueSetStandard" label="到期日设置标准">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.dueSetStandard === 1">按比例</el-tag>
                  <el-tag v-if="scope.row.dueSetStandard === 2">按金额</el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="dueTime" label="到期日计算日期">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.dueSetStandard === 1"
                    >订单日期</el-tag
                  >
                  <el-tag v-if="scope.row.dueSetStandard === 2"
                    >应收单业务日期</el-tag
                  >
                  <el-tag v-if="scope.row.dueSetStandard === 3"
                    >出库日期</el-tag
                  >
                </template>
              </el-table-column>
              <el-table-column prop="receiptType" label="收款方式">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.dueSetStandard === 1"
                    >按到期日收款</el-tag
                  >
                  <el-tag v-if="scope.row.dueSetStandard === 2"
                    >按订单收款</el-tag
                  >
                  <el-tag v-if="scope.row.dueSetStandard === 3"
                    >按物料明细收款</el-tag
                  >
                </template>
              </el-table-column>
              <el-table-column
                prop="conditionDesc"
                label="描述"
              ></el-table-column>
                <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      size="small"
                      @click="handleDetail(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      size="small"
                      icon="el-icon-edit"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      size="small"
                      icon="el-icon-delete"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 联系人 -->
          <template v-if="item.value === 'contracts'">
            <el-row class="export-container">
              <el-button type="primary" @click="addNewData('contracts')"
                >新增</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-upload2"
                size="mini"
                @click="exporting"
                >导出</el-button
              >
              <el-button type="primary" icon="el-icon-bottom" size="mini"
                >拉取</el-button
              >
              <el-button type="primary" icon="el-icon-download" size="mini"
                >导入</el-button
              >
            </el-row>
            <el-table
              ref="contractsTable"
              :data="tableContractsData"
              stripe
              style="width: 100%"
            >
              <el-table-column type="selection" width="55" align="center">
              </el-table-column>
              <el-table-column
                type="index"
                width="55"
                align="center"
                label="序号"
              >
              </el-table-column>
              <el-table-column prop="name" label="姓名"></el-table-column>
              <el-table-column
                prop="contactsCode"
                label="联系人编码"
              ></el-table-column>
              <el-table-column prop="position" label="职务"></el-table-column>
              <el-table-column prop="sex" label="性别">
                <template slot-scope="scope">
                  <span v-if="scope.row.sex === '1'">男</span>
                  <span v-if="scope.row.sex === '2'">女</span>
                  <span v-else>未知</span>
                </template>
              </el-table-column>
              <el-table-column prop="mobile" label="移动电话"></el-table-column>
              <el-table-column prop="fax" label="传真"></el-table-column>
              <el-table-column prop="email" label="邮件地址"></el-table-column>
              <el-table-column
                prop="belongCompany"
                label="所属公司"
              ></el-table-column>
              <el-table-column
                prop="addressName"
                label="地点名称"
              ></el-table-column>
              <el-table-column
                prop="address"
                label="详细地址"
              ></el-table-column>
              <el-table-column prop="userId" label="创建人"></el-table-column>
                <el-table-column label="操作" width="240">
                <template slot-scope="scope">
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="详情"
                    placement="bottom"
                  >
                    <el-button
                      plain
                      icon="el-icon-more"
                      size="small"
                      @click="handleDetail(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="编辑"
                    placement="bottom"
                  >
                    <el-button
                      type="primary"
                      plain
                      size="small"
                      icon="el-icon-edit"
                      @click="handleEdit(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="删除"
                    placement="bottom"
                  >
                    <el-button
                      type="danger"
                      plain
                      size="small"
                      icon="el-icon-delete"
                      @click="handleDelete(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="禁用"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 2"
                  >
                    <el-button
                      type="danger"
                      plain
                      icon="el-icon-error"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                  <el-tooltip
                    class="item"
                    effect="dark"
                    content="解禁"
                    placement="bottom"
                    v-if="scope.row.isDisabled == 1"
                  >
                    <el-button
                      type="primary"
                      plain
                      icon="el-icon-success"
                      size="mini"
                      @click="Banned(scope.$index, scope.row)"
                    ></el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
            </el-table>
          </template>
          <!-- 税收 -->
          <template v-if="item.value === 'taxation'">
            <el-row class="export-taxation">
              <el-col :span="3">
                <el-button type="primary" @click="addNewData('taxation')"
                  >新增</el-button
                >

                <el-button
                  type="primary"
                  icon="el-icon-upload2"
                  size="mini"
                  @click="exporting"
                  >导出</el-button
                >
              </el-col>
              <!-- <el-button
                                type="primary"
                                icon="el-icon-bottom"
                                size="mini"
                                >拉取</el-button
                            > -->
              <el-col :span="2">
                <el-upload
                  class="upload-demo"
                  action="http://81.68.255.108:8089/heart/kingBaseTaxType/excel"
                  :headers="headers"
                  :on-preview="handlePreview"
                  :on-remove="handleRemove"
                  :before-upload="beforeAvatarUpload"
                  :on-success="successFile"
                  :show-file-list="showfile"
                  multiple
                  :limit="3"
                  :on-exceed="handleExceed"
                >
                  <el-button size="mini" type="primary">点击上传</el-button>
                </el-upload>
              </el-col>
              <!-- <el-button type="primary" icon="el-icon-download" size="mini" @click="onImportExcel"
                >导入</el-button
              > -->
            </el-row>
            <el-table
              ref="contractsTable"
              :data="tableTaxationData"
              stripe
              style="width: 100%"
              v-loading="loadings"
            >
              <el-table-column type="selection" width="55" align="center">
              </el-table-column>
              <el-table-column prop="" width="150" align="docNo" label="编码">
              </el-table-column>
              <el-table-column
                prop="taxTypeCode"
                label="税收分类编码"
              ></el-table-column>
              <el-table-column
                prop="parentCode"
                label="上级编码"
              ></el-table-column>
              <el-table-column prop="title" label="名称"></el-table-column>
              <el-table-column prop="simpleTitle" label="简称">
              </el-table-column>
              <el-table-column prop="taxDesc" label="说明"></el-table-column>
              <el-table-column prop="taxRate" label="税率"></el-table-column>
              <el-table-column
                prop="preferentialTaxPolicy"
                label="税收优惠政策内容"
              ></el-table-column>
              <el-table-column prop="taxVersion" label="版本"></el-table-column>
              <el-table-column label="汇总项">
                <template slot-scope="scope">
                  <p v-if="scope.row.summaryItem == 1">是</p>
                  <p v-if="scope.row.summaryItem == 2">否</p>
                </template>
              </el-table-column>
              <!-- <el-table-column
                                prop="address"
                                label="数据状态"
                            ></el-table-column> -->
              <el-table-column label="系统预置">
                <template slot-scope="scope">
                  <p v-if="scope.row.isPreset == 1">是</p>
                  <p v-if="scope.row.isPreset == 2">否</p>
                </template>
              </el-table-column>
              <el-table-column
                prop="createUserId"
                label="创建人"
              ></el-table-column>
              <el-table-column
                prop="createDate"
                label="创建日期"
              ></el-table-column>
              <!-- <el-table-column
                                prop="userId"
                                label="修改人"
                            ></el-table-column>
                            <el-table-column
                                prop="userId"
                                label="修改日期"
                            ></el-table-column>
                            <el-table-column
                                prop="userId"
                                label="审核人"
                            ></el-table-column>
                            <el-table-column
                                prop="userId"
                                label="审核日期"
                            ></el-table-column> -->
              <el-table-column prop="userId" label="禁用状态"></el-table-column>
            </el-table>
          </template>
        </el-tab-pane>
        <el-pagination
          class="table-pagination"
          background
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          :page-sizes="[10, 15, 20, 30, 40]"
          :page-size="params.limit"
          :show-file-list="false"
          :current-page="params.page"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
        >
        </el-pagination>
      </el-tabs>
    </div>
    <!-- 弹出框 -->
    <el-drawer
      :title="rowId ? editTitle : addTitle"
      :visible.sync="drawer"
      direction="rtl"
      :before-close="handleClose"
      size="100%"
      destroy-on-close
    >
      <div class="drawer-content">
        <component :is="currentCom" ref="formRef" :id="rowId" :parentId="parentId"></component>
      </div>
      <div class="demo-drawer__footer">
        <el-button @click="cancelForm">取 消</el-button>
        <el-button type="primary" @click="submit">保存</el-button>
      </div>
    </el-drawer>
  </div>
</template>
<script>
import {
  getSettleData,
  getPaymentData,
  getCurrencyData,
  getExchangeData,
  getBankAccountkData,
  getContactData,
  getTaxData,
  getStockData,
  getCostData,
  getBankData,
  getSupplierData,
  getDocumentData,
  getDocumentTableData,
  getCustomerList,
  getWareList,
  getExpenseData,
  getGroupData,
  getPurchaseData,
  getPriceData,
  getPayData,
  getSupplyContact,
  getkingBaseTaxTypeData,
  downloadData,
  kingBaseTaxTypeexcel,
} from "@/api/base/data";
import {
  KingBaseCurrencydisabled,
  KingBaseSettlementTypedisabled,
  deleteKingBaseSettlementType,
  KingBaseReceiptPayPurposedisabled,
  deleteKingBaseReceiptPayPurposeType,
  deleteKingBaseCurrencyType, //币别删除
  deleteKingBaseRateType, //汇率体系删除
  KingBaseRateisabled, //禁用
  deleteKingBaseFeeType, //费用删除
  KingBaseFeeisabled, //费用禁用
  KingDocTypeisabled, //单据禁用
  deleteKingDocTypeType, //单据删除
  KingBankAccountisabled, //银行账号禁用
  deleteKingBankAccountType, //银行账号删除
  KingBaseTransactionsCompanyisabled, //往来单位禁用
  deleteKingBaseTransactionsCompanyType, //删除
  KingBaseTaxRateisabled, //税率禁用
  deleteKingBaseTaxRateType, //删除
  KingBaseSafetyStockisabled, //安全库存设置禁用
  deleteKingBaseSafetyStockType, //删除
  deptisabled, //禁用部门
  deletedeptType, //删除部门
  KingBaseCostCenterisabled, //成本中新禁用
  deleteKingBaseCostCenterType, //删除
  KingBaseBankisabled, //银行禁用
  deleteKingBaseBankType, //删除
  Warehouseisabled, //仓库仓位禁用
  deleteWarehouseType, //删除
  Customerisabled, //客户禁用
  deleteCustomerType, //删除
  Supplierisabled, //供应商禁用
  deleteSupplierType, //删除
  Materialisabled, //物料禁用
  deleteMaterialType, //删除
  KingBaseSupplierGroupisabled, //供应商分组禁用
  deleteKingBaseSupplierGroupType, //删除
  KingBaseReceiptConditionisabled, //收款条件禁用
  deleteKingBaseReceiptConditionType, //删除
  KingBaseContactsisabled, //联系人
  deleteKingBaseContactsType, //删除
  KingPurchasePriceisabled,//价目表
  deleteKingPurchasePriceType,//删除
} from "@/api/bim/outher";
import {
  getMaterialTypeList,
  getMaterialInfoList,
} from "@/api/system/warehouse";
import { handleTree } from "@/utils/utils";
import { listDept } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Settlement from "./add/settlement";
import Payment from "./add/payment";
import Currency from "./add/currency";
import Exchange from "./add/exchange";
import Expense from "./add/expense";
import BankAccount from "./add/bankAccount";
import Contact from "./add/contact";
import Tax from "./add/tax";
import Stock from "./add/stock";
import Cost from "./add/cost";
import Bank from "./add/bank";
import Department from "./add/department";
import Ware from "./add/ware";
import Customer from "./add/customer";
import Supplier from "./add/supplier";
import DocumentCom from "./add/document";
import Group from "./add/group";
import Purchase from "./add/purchase";
import Price from "./add/price";
import Pay from "./add/pay";
import Contracts from "./add/contracts";
import Taxation from "./add/taxation";
import Material from "./add/material";
import { getToken } from "@/utils/auth";
export default {
  components: {
    Settlement,
    Payment,
    Currency,
    Exchange,
    Expense,
    BankAccount,
    Contact,
    Tax,
    Stock,
    Cost,
    Bank,
    Department,
    Ware,
    Customer,
    Supplier,
    DocumentCom,
    Group,
    Purchase,
    Price,
    Pay,
    Contracts,
    Material,
    Taxation,
  },
  data() {
    return {
       treeData:[],
      showfile:false,
      flagNum: 1,
      loadings: false,
      activeName: "settlement",
      loading: false,
      materialLoading: false,
      // 查询参数
      queryParams: {
        deptName: undefined,
        status: undefined,
      },
      tableSettleData: [], //结算方式
      tablePaymentData: [], //收付款用途
      tableCurrencyData: [], //币别
      tableExchangeData: [], //汇率体系
      tableExpenseData: [], //费用项目
      tableBankAccountData: [], //银行账户
      tableContactData: [], //往来单位
      tableTaxData: [], //税率
      tableStockData: [], //安全库存设置
      tableCostData: [], //成本
      tableBankData: [], //银行
      tableSupplierData: [], //供应商
      treeDataDoc: [], //单据类型左侧树
      tableDocumentData: [], //单据类型
      tableGroupData: [], //供应商分组
      tablePurchaseData: [], //采购组
      tablePriceData: [], //默认价目表
      tablePayData: [], //收付款条件
      tableContractsData: [], //收付款条件
      tableTaxationData: [], //税收

      //单据类型树结构字段
      defaultPropsDoc: {
        children: "treeList",
        label: "title",
      },
      deptList: [], //部门
      tableWareData: [], //仓库
      treeDataMaterial: [], //物料左侧树
      tableDataMaterial: [], //物料
      tableCustomerData: [], //客户
      //物料树结构字段
      defaultProps: {
        children: "treeList",
        label: "typeName",
      },

      total: 0, //分页总条数
      params: {
        limit: 10, //每页条数
        page: 1, //当前页
      },

      selectRows: [],
      tabData: [
        {
          label: "结算方式",
          value: "settlement",
        },
        {
          label: "收付款用途",
          value: "payment",
        },
        {
          label: "币别",
          value: "currency",
        },
        {
          label: "汇率体系",
          value: "exchange",
        },
        {
          label: "费用项目",
          value: "expense",
        },
        {
          label: "单据类型",
          value: "document",
        },
        {
          label: "银行账户",
          value: "bankAccount",
        },
        {
          label: "其他往来单位",
          value: "contact",
        },
        {
          label: "税率",
          value: "tax",
        },
        {
          label: "安全库存设置",
          value: "stock",
        },
        {
          label: "部门",
          value: "department",
        },
        {
          label: "成本中心",
          value: "cost",
        },
        {
          label: "银行",
          value: "bank",
        },
        {
          label: "仓库及仓位",
          value: "warehouse",
        },
        {
          label: "客户",
          value: "customer",
        },
        {
          label: "供应商",
          value: "supplier",
        },
        {
          label: "物料",
          value: "material",
        },
        {
          label: "供应商分组",
          value: "group",
        },
        {
          label: "采购组",
          value: "purchase",
        },
        {
          label: "默认价目表",
          value: "price",
        },
        {
          label: "收付款条件",
          value: "pay",
        },
        {
          label: "联系人",
          value: "contracts",
        },
        {
          label: "税收分类编码",
          value: "taxation",
        },
      ],
      drawer: false,
      rowId: "",
      parentId:'',
      editTitle: "",
      addTitle: "",
      currentCom: "",
      token: "",
    };
  },
  computed: {
    headers() {
      return {
        Authorization: this.token, // 直接从本地获取token就行
      };
    },
  },
  methods: {
    // 导入loadings
   
    successFile(){
      this.loadings=false
    },
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePreview(file) {
      console.log(file);
    },
    handleExceed(files, fileList) {
      this.$message.warning(`最多上传 ${this.limit} 个文件。`);
    },
    beforeAvatarUpload(file) {
      this.loadings=true
      var testmsg = file.name.substring(file.name.lastIndexOf(".") + 1);
      //   console.log(testmsg);
      const extension = testmsg === "xls";
      const extension2 = testmsg === "xlsx";
      // const isLt2M = file.size / 1024 / 1024 < 10;
      if (!extension && !extension2) {
        // console.log(11111111);
        this.$message({
          message: "上传文件只能是 xls、xlsx格式!",
          type: "warning",
        });
      }
      // if (!isLt2M) {
      //   this.$message({
      //     message: "上传文件大小不能超过 10MB!",
      //     type: "warning"
      //   });
      // }
      // return extension || (extension2 && isLt2M);
      return extension || extension2;
    },

    // 导出
    exporting() {
      downloadData().then((res) => {
        let blob = new Blob([res.data], {
          type: "application/vnd.ms-excel",
        }); // 将服务端返回的文件流（二进制）excel文件转化为blob
        let fileName = "税收分类.xls";

        if (window.navigator && window.navigator.msSaveOrOpenBlob) {
          // IE
          window.navigator.msSaveOrOpenBlob(blob, fileName);
        } else {
          let objectUrl = (window.URL || window.webkitURL).createObjectURL(
            blob
          );
          let downFile = document.createElement("a");
          downFile.style.display = "none";
          downFile.href = objectUrl;
          downFile.download = fileName; // 下载后文件名
          document.body.appendChild(downFile);
          downFile.click();
          document.body.removeChild(downFile); // 下载完成移除元素
          // window.location.href = objectUrl
          window.URL.revokeObjectURL(objectUrl); // 只要映射存在，Blob就不能进行垃圾回收，因此一旦不再需要引用，就必须小心撤销URL，释放掉blob对象。
        }
      });
    },
    handleSelectionChange() {},
    handleSizeChange(val) {
      this.params.limit = val;
      this.refresh();
    },
    handleCurrentChange(val) {
      this.params.page = val;
      this.refresh();
    },
    // 新增
    addNewData(type) {
      this.rowId = "";
      this.parentId='',
      this.drawer = true;
      this.handleAdd();
    },
    // 新增处理动态组件
    handleAdd() {
      const nameMap = {
        settlement: () => {
          this.addTitle = "新增结算";
          this.currentCom = Settlement;
        },
        payment: () => {
          this.addTitle = "新增收付款";
          this.currentCom = Payment;
        },
        currency: () => {
          this.addTitle = "新增币别";
          this.currentCom = Currency;
        },
        exchange: () => {
          this.addTitle = "新增汇率";
          this.currentCom = Exchange;
        },
        expense: () => {
          this.addTitle = "新增费用";
          this.currentCom = Expense;
        },
        document: () => {
          this.addTitle = "新增单据";
          this.currentCom = DocumentCom;
        },
        bankAccount: () => {
          this.addTitle = "新增银行账户";
          this.currentCom = BankAccount;
        },
        contact: () => {
          this.addTitle = "新增往来单位";
          this.currentCom = Contact;
        },
        tax: () => {
          this.addTitle = "新增税率";
          this.currentCom = Tax;
        },
        stock: () => {
          this.addTitle = "新增库存";
          this.currentCom = Stock;
        },
        department: () => {
          this.addTitle = "新增部门";
          this.currentCom = Department;
        },
        cost: () => {
          this.addTitle = "新增成本";
          this.currentCom = Cost;
        },
        bank: () => {
          this.addTitle = "新增银行";
          this.currentCom = Bank;
        },
        warehouse: () => {
          this.addTitle = "新增仓库";
          this.currentCom = Ware;
        },
        customer: () => {
          this.addTitle = "新增客户";
          this.currentCom = Customer;
        },
        supplier: () => {
          this.addTitle = "新增供应商";
          this.currentCom = Supplier;
        },
        material: () => {
          this.addTitle = "新增物料";
          this.currentCom = Material;
        },
        group: () => {
          this.addTitle = "新增供应商分组";
          this.currentCom = Group;
        },
        purchase: () => {
          this.addTitle = "新增采购组";
          this.currentCom = Purchase;
        },
        price: () => {
          this.addTitle = "新增默认价目表";
          this.currentCom = Price;
        },
        pay: () => {
          this.addTitle = "新增收付款条件";
          this.currentCom = Pay;
        },
        contracts: () => {
          this.addTitle = "新增联系人";
          this.currentCom = Contracts;
        },
        taxation: () => {
          this.addTitle = "税收分类编码";
          this.currentCom = Taxation;
        },
      };
      nameMap[this.activeName] ? nameMap[this.activeName]() : "";
    },
    getRow(row){
      
      this.rowId = row.id;
      this.parentId=row.deptId
      this.drawer = true;
      this.handleEditlist(row);
    },
    // 编辑
    handleEdit(i, row) {
      this.rowId = row.id;
      this.parentId=row.deptId
      this.drawer = true;
      this.handleEditlist(row);
    },
    // 修改处理动态组件
    handleEditlist() {
      const nameMap = {
        settlement: () => {
          this.editTitle = "修改结算";
          this.currentCom = Settlement;
        },
        payment: () => {
          this.editTitle = "修改收付款";
          this.currentCom = Payment;
        },
        currency: () => {
          this.editTitle = "修改币别";
          this.currentCom = Currency;
        },
        exchange: () => {
          this.editTitle = "修改汇率";
          this.currentCom = Exchange;
        },
        expense: () => {
          this.editTitle = "修改费用";
          this.currentCom = Expense;
        },
        document: () => {
          this.editTitle = "修改单据";
          this.currentCom = DocumentCom;
        },
        bankAccount: () => {
          this.editTitle = "修改银行账户";
          this.currentCom = BankAccount;
        },
        contact: () => {
          this.editTitle = "修改往来单位";
          this.currentCom = Contact;
        },
        tax: () => {
          this.editTitle = "修改税率";
          this.currentCom = Tax;
        },
        stock: () => {
          this.editTitle = "修改库存";
          this.currentCom = Stock;
        },
        department: () => {
          this.editTitle = "修改部门";
          this.currentCom = Department;
        },
        cost: () => {
          this.editTitle = "修改成本";
          this.currentCom = Cost;
        },
        bank: () => {
          this.editTitle = "修改银行";
          this.currentCom = Bank;
        },
        warehouse: () => {
          this.editTitle = "修改仓库";
          this.currentCom = Ware;
        },
        customer: () => {
          this.editTitle = "修改客户";
          this.currentCom = Customer;
        },
        supplier: () => {
          this.editTitle = "修改供应商";
          this.currentCom = Supplier;
        },
        material: () => {
          this.editTitle = "修改物料";
          this.currentCom = Material;
        },
        group: () => {
          this.editTitle = "修改供应商分组";
          this.currentCom = Group;
        },
        purchase: () => {
          this.editTitle = "修改采购组";
          this.currentCom = Purchase;
        },
        price: () => {
          this.editTitle = "修改默认价目表";
          this.currentCom = Price;
        },
        pay: () => {
          this.editTitle = "修改收付款条件";
          this.currentCom = Pay;
        },
        contracts: () => {
          this.editTitle = "修改联系人";
          this.currentCom = Contracts;
        },
        taxation: () => {
          this.editTitle = "修改税收分类编码";
          this.currentCom = Taxation;
        },
      };
      nameMap[this.activeName] ? nameMap[this.activeName]() : "";
    },
    // 初始请求/刷新数据
    refresh() {
      const nameMap = {
        settlement: () => {
          this.getDataSettle(this.params);
          this.flagNum = 1;
        },
        payment: () => {
          this.getDataPayment(this.params);
          this.flagNum = 2;
        },
        currency: () => {
          this.getDataCurrency(this.params);
          this.flagNum = 3;
        },
        exchange: () => {
          this.getDataExchange(this.params);
          this.flagNum = 4;
        },
        expense: () => {
          this.getDataExpense(this.params);
          this.flagNum = 5;
        },
        document: () => {
          this.getDataDocument(this.params);
          this.flagNum = 6;
        },
        bankAccount: () => {
          this.getDataBankAccount(this.params);
          this.flagNum = 7;
        },
        contact: () => {
          this.getDataContact(this.params);
          this.flagNum = 8;
        },
        tax: () => {
          this.getDataTax(this.params);
          this.flagNum = 9;
        },
        stock: () => {
          this.getDataStock(this.params);
          this.flagNum = 10;
        },
        department: () => {
          this.getListDepartment(this.params);
          this.flagNum = 11;
        },
        cost: () => {
          this.getDataCost(this.params);
          this.flagNum = 12;
        },
        bank: () => {
          this.getDataBank(this.params);
          this.flagNum = 13;
        },
        warehouse: () => {
          this.getDataWarehouse(this.params);
          this.flagNum = 14;
        },
        customer: () => {
          this.getDataCustomer(this.params);
          this.flagNum = 15;
        },
        supplier: () => {
          this.getDataSupplier(this.params);
          this.flagNum = 16;
        },
        material: () => {
          this.getDataMaterial(this.params);
          this.flagNum = 17;
        },
        group: () => {
          this.getDataGroup(this.params);
          this.flagNum = 18;
        },
        purchase: () => {
          this.getDataPurchase(this.params);
          this.flagNum = 19;
        },
        price: () => {
          this.getDataPrice(this.params);
          this.flagNum = 20;
        },
        pay: () => {
          this.getDataPay(this.params);
          this.flagNum = 21;
        },
        contracts: () => {
          this.getDataContracts(this.params);
          this.flagNum = 22;
        },
        taxation: () => {
          this.getDataTaxation(this.params);
          this.flagNum = 23;
        },
      };
      nameMap[this.activeName] ? nameMap[this.activeName]() : "";
    },

    // 关闭drawer
    handleClose(done) {
      this.$confirm("确认关闭？")
        .then((_) => {
          done();
          // this.rowId = "";
          // this.getData();
          this.refresh();
        })
        .catch((_) => {});
    },

    // 提交表单
    submit() {
      const cb = () => {
        this.drawer = false;
        this.refresh();
      };
      this.$refs.formRef.submitForm(cb);
    },
    // 取消表单
    cancelForm() {
      this.drawer = false;
      this.rowId = "";
      this.$refs.formRef.resetForm(this.refresh);
    },
    // tab切换
    handleClick(val) {
      this.params.page=1
      this.activeName = val.name;
      this.refresh();
    },
    // 结算方式
    getDataSettle(params) {
      // let pageSize = pageSize;
      // let currentPage = currentPage;
      getSettleData(params).then((res) => {
        // if (res.code === 200) {
        this.tableSettleData = res.rows;
        this.total = res.total;
        // }
      });
    },
    //收付款用途
    getDataPayment(params) {
      // console.log("调用了");
      getPaymentData(params).then((res) => {
        if (res.code === 200) {
          this.tablePaymentData = res.data.records;
          this.total = res.data.total;
        }
      });
    },
    //币别
    getDataCurrency(params) {
      getCurrencyData(params).then((res) => {
        // if (res.code === 200) {
        this.tableCurrencyData = res.rows;
        this.total = res.total;
        // }
      });
    },
    //汇率体系
    getDataExchange(params) {
      getExchangeData(params).then((res) => {
        if (res.code === 200) {
          this.tableExchangeData = res.rows;
          this.total = res.total;
        }
      });
    },
    //费用项目
    getDataExpense(params) {
      getExpenseData(params).then((res) => {
        // if (res.code === 200) {
        this.tableExpenseData = res.rows;
        this.total = res.total;
        // }
      });
    },
    //部门列表
    getListDepartment(params) {
      this.loading = true;
      listDept(this.queryParams, params).then((response) => {
        this.deptList = this.handleTree(response.data, "deptId");
        this.loading = false;
      });
    },
    // 部门列表 字典状态字典翻译
    statusFormat(row, column) {
      return this.selectDictLabel(this.statusOptions, row.status);
    },

    // 部门列表 修改
    handleUpdate() {},

    // 银行账户
    getDataBankAccount(params) {
      getBankAccountkData(params).then((res) => {
        // if (res.code === 200) {
        this.tableBankAccountData = res.rows;
        this.total = res.total;
        // }
      });
    },
    // 联系人
    getDataContact(params) {
      getContactData(params).then((res) => {
        // if (res.code === 200) {
        this.tableContactData = res.rows;
        this.total = res.total;
        // }
      });
    },
    // 税种
    getDataTax(params) {
      getTaxData(params).then((res) => {
        // if (res.code === 200) {
        this.tableTaxData = res.rows;
        this.total = res.total;
        // }
      });
    },
    // 安全库存
    getDataStock(params) {
      getStockData(params).then((res) => {
        if (res.code === 200) {
          this.tableStockData = res.data.records;
          this.total = res.data.total;
        }
      });
    },
    //成本
    getDataCost(params) {
      getCostData(params).then((res) => {
        // if (res.code === 200) {
        this.tableCostData = res.rows;
        this.total = res.total;
        // }
      });
    },
    // 银行
    getDataBank(params) {
      getBankData(params).then((res) => {
        // if (res.code === 200) {
        this.tableBankData = res.rows;
        this.total = res.total;
        // }
      });
    },
    // 供应商
    getDataSupplier(params) {
      getSupplierData(params).then((res) => {
        if (res.code === 200) {
          this.tableSupplierData = res.rows;
          this.total = res.total;
        }
      });
    },
    // 单据类型左侧树
    getDataDocument(params) {
      getDocumentData(params).then((res) => {
        if (res.code === 200) {
          // this.tableDocumentData = res.rows;
          // this.total = res.total;
          this.treeDataDoc = this.handleTree(
            res.rows,
            "docCode",
            "parentCode",
            "treeList"
          );
        }
      });
    },
    // 单据类型 树点击事件
    handleNodeClick(data) {
      getDocumentTableData({ docCode: data.docCode }).then((res) => {
        if (res.code === 200) {
          this.tableDocumentData = res.rows;
          this.total = res.total;
        }
      });
    },
    // getDataDocument() {
    //     getDocumentData().then((res) => {
    //         if (res.code === 200) {
    //             this.tableDocumentData = res.rows;
    //             this.total = res.total;
    //         }
    //     });
    // },
    //仓库
    getDataWarehouse(params) {
      getWareList(params).then((res) => {
        if (res.code === 200) {
          this.tableWareData = res.rows;
          this.total = res.total;
        }
      });
    },
    //客户
    getDataCustomer(params) {
      let type = 3;
      params.type = 3;
      getCustomerList(params).then((res) => {
        if (res.code === 200) {
          this.tableCustomerData = res.rows;
          this.total = res.total;
        }
      });
    },
    // 物料
    getDataMaterial(params) {
      getMaterialTypeList(params).then((res) => {
        this.treeDataMaterial = res.data;
        this.handleNodeClickMaterial(this.treeDataMaterial[0]);
      });
    },
    // 物料树 node点击
    handleNodeClickMaterial(data) {
      this.materialLoading = true;
      let parentId = data.id;
      getMaterialInfoList({ parentId }).then((res) => {
        res.data.records.forEach(element => {
          this.treeData.push(element.id)
        });
        this.tableDataMaterial = res.data.records;
        this.materialLoading = false;
      });
    },
    // 供应商分组
    getDataGroup(params) {
      getGroupData(params).then((res) => {
        if (res.code === 200) {
          this.tableGroupData = res.data.records;
          this.total = res.data.total;
        }
      });
    },
    // 采购组
    getDataPurchase(params) {
      getPurchaseData(params).then((res) => {
        if (res.code === 200) {
          this.tablePurchaseData = res.rows;
          this.total = res.total;
        }
      });
    },
    // 默认价目表
    getDataPrice(params) {
      getPriceData(params).then((res) => {
        if (res.code === 200) {
          this.tablePriceData = res.data.records;
          this.total = res.data.total;
        }
      });
    },
    // 收付款条件
    getDataPay(params) {
      getPayData(params).then((res) => {
        if (res.code === 200) {
          this.tablePayData =res.data.records;
          this.total = res.data.total;
        }
      });
    },
    // 联系人
    getDataContracts(params) {
      getSupplyContact(params).then((res) => {
        this.tableContractsData = res.data.records;
        this.total = res.data.total;
      });
    },
    // 税收
    getDataTaxation(params) {
      getkingBaseTaxTypeData({
        params,
      }).then((res) => {
      
        this.tableTaxationData = res.data.records;
        this.total = res.data.total;
      });
    },
    // 部门列表 删除
    handleDelete(i, row) {
      var deletelist = "";
      var deleteListData = [
        deleteKingBaseSettlementType,
        deleteKingBaseReceiptPayPurposeType,
        deleteKingBaseCurrencyType,
        deleteKingBaseRateType,
        deleteKingBaseFeeType,
        deleteKingDocTypeType,
        deleteKingBankAccountType,
        deleteKingBaseTransactionsCompanyType,
        deleteKingBaseTaxRateType,
        deleteKingBaseSafetyStockType,
        deletedeptType,
        deleteKingBaseCostCenterType,
        deleteKingBaseBankType,
        deleteWarehouseType,
        deleteCustomerType,
        deleteSupplierType,
        deleteMaterialType,
        deleteKingBaseSupplierGroupType,
        ,
        deleteKingPurchasePriceType,
        deleteKingBaseReceiptConditionType,
        deleteKingBaseContactsType,
      ];
      for (let i = 0; i < deleteListData.length; i++) {
        if (this.flagNum == i + 1) {
          deletelist = deleteListData[i];
        }
      }

      this.$confirm("请确定要删除所选的记录吗？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          deletelist(row.id).then((res) => {
            // console.log(res);
            if (res.code === 200) {
               this.refresh();
              this.tableData.splice(index, 1);
              this.$message({
                type: "success",
                message: "删除成功!",
              });
             
            }
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    // 封禁
    Banned(i, row) {
      // isDisabled 1 正常 2 封禁
      console.log(this.flagNum);
      var isabledlist = [
        KingBaseSettlementTypedisabled,
        KingBaseReceiptPayPurposedisabled,
        KingBaseCurrencydisabled,
        KingBaseRateisabled,
        KingBaseFeeisabled,KingDocTypeisabled,
        KingBankAccountisabled,
        KingBaseTransactionsCompanyisabled,
        KingBaseTaxRateisabled,
        KingBaseSafetyStockisabled,
        deptisabled,
        KingBaseCostCenterisabled,
        KingBaseBankisabled,
        Warehouseisabled,
        Customerisabled,
        Supplierisabled,
        Materialisabled,
        KingBaseSupplierGroupisabled,,
        KingPurchasePriceisabled,
        KingBaseReceiptConditionisabled,
        KingBaseContactsisabled
      ];
      var isabledflag = row.isDisabled;
      var isabledlistone = ''
       for (let i = 0; i < isabledlist.length; i++) {
        if (this.flagNum == i + 1) {
          isabledlistone = isabledlist[i];
        }
      }
      // if (this.flagNum == 1) {
      //   KingBaseSettlementTypedisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 2) {
      //   KingBaseReceiptPayPurposedisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 3) {
      //   KingBaseCurrencydisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 4) {
      //   KingBaseRateisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 5) {
      //   KingBaseFeeisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 6) {
      //   KingDocTypeisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 7) {
      //   KingBankAccountisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 8) {
      //   KingBaseTransactionsCompanyisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 9) {
      //   KingBaseTaxRateisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 10) {
      //   KingBaseSafetyStockisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 11) {
      //   deptisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 12) {
      //   KingBaseCostCenterisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 13) {
      //   KingBaseBankisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 14) {
      //   Warehouseisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 15) {
      //   Customerisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 16) {
      //   Supplierisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 17) {
      //   Materialisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 18) {
      //   KingBaseSupplierGroupisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 19) {
      //   Materialisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 20) {
      //   Materialisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 21) {
      //   KingBaseReceiptConditionisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // } else if (this.flagNum == 22) {
      //   KingBaseContactsisabled({ id: row.id }).then((res) => {
      //     this.refresh();
      //   });
      // }
      this.$confirm(`请确定要${isabledflag==1?'封禁':'解封'}所选的记录吗？`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          isabledlistone({id:row.id}).then((res) => {
            if (res.code === 200) {
              this.refresh();
              this.$message({
                type: "success",
                message: "操作成功!",
              });
              
            }
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
  },

  created() {
    this.token = getToken();

    this.getDataSettle();
    this.getDicts("sys_normal_disable").then((response) => {
      this.statusOptions = response.data;
    });
    // this.handleNodeClickMaterial()
  },
};
</script>
<style>
.avatar-uploader /deep/ .el-upload-list__item {
      transition: none !important;
    }
.el-upload-list__item-name{
  display: none;
}
</style>
<style lang="scss" scoped>
.filter-container {
  margin-bottom: 15px;
}

.export-container {
  margin: 15px 0;
}

.panel-title {
  font-size: 18px;
  color: #37474f;
  font-weight: 500;
  text-shadow: rgba(0, 0, 0, 0.15) 0 0 1px;
}

.divider {
  margin: 0;
}
</style>
